<template>
  <div>
    <div class="contentTopTitle">
      <div class="fl">
        <div class="title">千人千面的收入分析</div>
      </div>
    </div>
    <div class="operation">
      <el-form :inline="true" :model="form" label-width="80px" class="formList">
        <!--  <el-form-item label="选择区域">
          <dx-cascader  :area_id.sync="form.areaId" />
        </el-form-item> -->
        <el-form-item label="账期">
          <el-date-picker v-model="form.month" value-format="yyyyMM" type="month" placeholder="选择月"></el-date-picker>
        </el-form-item>
        <el-form-item label="区域">
          <dx-cascader :area_id.sync="form.areaId" ref="cascader" />
        </el-form-item>
        <el-form-item>
          <el-button size="small" type="primary" @click="submitHandle()">查询</el-button>
          <el-button size="small" type="orange" @click="getPdf()">导出</el-button>
        </el-form-item>
      </el-form>
    </div>
    <div id="pdfDom" style="padding: 20px;">
      <page1 :areaId="form.areaId" :month="form.month" ref="tab1"></page1>
    </div>
  </div>
</template>
<script>
import page1 from "./page/page1.vue";
import { getSessionStorage } from "@/common/js/storage";
let accountInfo = JSON.parse(getSessionStorage("accountInfo"));
export default {
    name: "showpdf",
    components: {
        page1
    },
    data() {
        return {
            htmlTitle: "经营分析",
            form: {
                areaId: accountInfo.areaId,
                month: ""
            },
            currentLvlName: ""
        };
    },
    created() {
        this.init();
        this.form.month = this.moment().subtract(1, "months").format("YYYYMM");
    },
    mounted() {
        this.submitHandle();
    },
    methods: {
        init() {
            this.accountInfo = JSON.parse(getSessionStorage("accountInfo"));
        },
        submitHandle() {
            this.$refs.tab1.init();
        }
    }
};
</script>

<style>
</style>
